-
Notifications
You must be signed in to change notification settings - Fork 29.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: fix/improve inspector profiler example #19379
Conversation
doc/api/inspector.md
Outdated
// write profile to disk, upload, etc. | ||
fs.writeFileSync('./profile.cpuprofile', JSON.stringify(profile)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have a policy on whether to include the require
calls for common modules such as fs
in sample code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a require of 'fs'.
doc/api/inspector.md
Outdated
// write profile to disk, upload, etc. | ||
fs.writeFileSync('./profile.cpuprofile', JSON.stringify(profile)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the example use profile
only if err
is falsy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
c22568b
to
fbaa4c9
Compare
The first parameter to the callback is `err`. Fix that. Expand example to demonstrate an actual write to disk. PR-URL: nodejs#19379 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
fbaa4c9
to
2725acf
Compare
Landed in 2725acf. |
The first parameter to the callback is `err`. Fix that. Expand example to demonstrate an actual write to disk. PR-URL: #19379 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
The first parameter to the callback is
err
. Fix that. Expand exampleto demonstrate an actual write to disk.
Checklist
CI-lite:
https://ci.nodejs.org/job/node-test-commit-lite/410/https://ci.nodejs.org/job/node-test-commit-lite/433/